#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>

int main (int argc, char *argv[])
{
        char * prog = "/testdir/testdir";                   
        char * arg = NULL;                                                                                                                      
        char * args_n[3];

        args_n[0] = prog;
        args_n[1] = arg;
        args_n[2] = NULL;

  int fd = open("parenttext.txt",O_RDONLY);

  if (fd == 0)
    printf("fail\n");
  else
    printf("success\n");

  pid_t ret = fork();

  if (ret == 0) {
    execv("/testdir/testdir", args_n);
  }

  wait();

  exit(0);
}
